package com.heima.web.intercepter;
import com.heima.tools.SessionUtils;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;

public class MyfilterInterceptor extends MethodFilterInterceptor {

	@Override
	protected String doIntercept(ActionInvocation arg0) throws Exception {
		Object user = SessionUtils.getSession().getAttribute("user");
		if (user != null) {
			return arg0.invoke();
		} else {
			return "login";
		}
		
	}

}
